package cn.smile.controller.core;

import cn.smile.business.core.IWebsiteService;
import cn.smile.commons.response.MyResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/website")
public class WebsiteController {
    @Resource
    private IWebsiteService service;

    @GetMapping(value = "dns")
    public MyResult<Boolean> dns(@RequestParam("ip") String ip, @RequestParam("hostname") String hostname, @RequestParam("accessKey") String accessKey, @RequestParam("secretKey") String secretKey) {
        return MyResult.OK(service.changeDns(ip, hostname, accessKey, secretKey));
    }
}
